home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / _GUICtrlEditGetFirstVisibleLine.au3 < prev    next >
Text File  |  2006-06-17  |  961b  |  30 lines

  1. #include <GUIConstants.au3>
  2. #include <GuiEdit.au3>
  3.  
  4. opt('MustDeclareVars', 1)
  5.  
  6. Dim $myedit, $Status, $msg, $Btn_get
  7.  
  8. GUICreate("Edit Get First Visible Line", 392, 254)
  9.  
  10. $myedit = GUICtrlCreateEdit("First line" & @CRLF, 140, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL)
  11. $Btn_get = GUICtrlCreateButton("Get", 150, 150)
  12. $Status = GUICtrlCreateLabel("", 0, 234, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))
  13.  
  14. ; will be append dont' forget 3rd parameter
  15. GUICtrlSetData($myedit, "2nd line" & @CRLF & "3rd line" & @CRLF & "4th line" & @CRLF & _
  16.       "5th line" & @CRLF & "6th line" & @CRLF & "7th line" & @CRLF & "8th line" & @CRLF & "9th line", 1)
  17.  
  18. GUISetState()
  19.  
  20. ; Run the GUI until the dialog is closed
  21. While 1
  22.    $msg = GUIGetMsg()
  23.    Select
  24.       Case $msg = $GUI_EVENT_CLOSE
  25.          ExitLoop
  26.       Case $msg = $Btn_get
  27.          GUICtrlSetData($Status, "First Visible Line: " & _GUICtrlEditGetFirstVisibleLine ($myedit))
  28.    EndSelect
  29. WEnd
  30.